Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speeding up saving to .obj and .ply #1580

Merged
merged 1 commit into from
Jun 30, 2016
Merged

speeding up saving to .obj and .ply #1580

merged 1 commit into from
Jun 30, 2016

Conversation

morrisfranken
Copy link
Contributor

By replacing std::endl with '\n', saving to disk can be sped up by roughly 15 times.

Issue: #1573

@VictorLamoine
Copy link
Contributor

It does not improve anything on my machine.
PCL trunk with your patch, compiled in debug mode.

@SergioRAgostinho
Copy link
Member

@VictorLamoine While you're at it, do you mind testing it in release mode?

@VictorLamoine
Copy link
Contributor

Exactly the same results!

@morrisfranken
Copy link
Contributor Author

That is very strange, I've tested the following on Linux, Windows and OSX across different machines, but in all cases, this patch sped up the save function between 2 and 20 times (on SSD the speedup is around 2-3 while much higher on the SATA disks).

#include <iostream>
#include <boost/date_time/time.hpp>
#include <pcl/point_cloud.h>
#include <pcl/io/obj_io.h>
#include <pcl/io/ply_io.h>

using namespace std;
using namespace pcl;

class StopWatch
{
    boost::posix_time::ptime before;
    boost::posix_time::ptime after;
public:
    void start() {
        before = boost::posix_time::microsec_clock::local_time();
    }

    double stop() {
        after = boost::posix_time::microsec_clock::local_time();
        return (static_cast<double> ((after - before).total_milliseconds()));
    }
};

int oldsaveOBJFile (const std::string &file_name,
        const pcl::PolygonMesh &mesh, unsigned precision=5)
{
    if (mesh.cloud.data.empty ())
    {
        PCL_ERROR ("[pcl::io::saveOBJFile] Input point cloud has no data!\n");
        return (-1);
    }
    // Open file
    std::ofstream fs;
    fs.precision (precision);
    fs.open (file_name.c_str ());

    /* Write 3D information */
    // number of points
    int nr_points  = mesh.cloud.width * mesh.cloud.height;
    // point size
    unsigned point_size = static_cast<unsigned> (mesh.cloud.data.size () / nr_points);
    // number of faces for header
    unsigned nr_faces = static_cast<unsigned> (mesh.polygons.size ());
    // Do we have vertices normals?
    int normal_index = getFieldIndex (mesh.cloud, "normal_x");
    const float *mesh_cloud_data = (float *)&mesh.cloud.data[0];

    // Write the header information
    fs << "####" << std::endl;
    fs << "# OBJ dataFile simple version. File name: " << file_name << std::endl;
    fs << "# Vertices: " << nr_points << std::endl;
    if (normal_index != -1)
        fs << "# Vertices normals : " << nr_points << std::endl;
    fs << "# Faces: " <<nr_faces << std::endl;
    fs << "####" << std::endl;

    // Write vertex coordinates
    fs << "# List of Vertices, with (x,y,z) coordinates, w is optional." << std::endl;
    for (int i = 0; i < nr_points; ++i)
    {
        int xyz = 0;
        for (size_t d = 0; d < mesh.cloud.fields.size (); ++d)
        {
            int c = 0;
            // adding vertex
            if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && (
                    mesh.cloud.fields[d].name == "x" ||
                    mesh.cloud.fields[d].name == "y" ||
                    mesh.cloud.fields[d].name == "z"))
            {
                if (mesh.cloud.fields[d].name == "x")
                    // write vertices beginning with v
                    fs << "v ";

                float value;
                memcpy (&value, &mesh.cloud.data[i * point_size + mesh.cloud.fields[d].offset + c * sizeof (float)], sizeof (float));
                fs << value;
                if (++xyz == 3)
                    break;
                fs << " ";
            }
        }
        if (xyz != 3)
        {
            PCL_ERROR ("[pcl::io::saveOBJFile] Input point cloud has no XYZ data!\n");
            return (-2);
        }
        fs << std::endl;
    }

    fs << "# "<< nr_points <<" vertices" << std::endl;

    if(normal_index != -1)
    {
        fs << "# Normals in (x,y,z) form; normals might not be unit." <<  std::endl;
        // Write vertex normals
        for (int i = 0; i < nr_points; ++i)
        {
            int nxyz = 0;
            for (size_t d = 0; d < mesh.cloud.fields.size (); ++d)
            {
                int c = 0;
                // adding vertex
                if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && (
                        mesh.cloud.fields[d].name == "normal_x" ||
                        mesh.cloud.fields[d].name == "normal_y" ||
                        mesh.cloud.fields[d].name == "normal_z"))
                {
                    if (mesh.cloud.fields[d].name == "normal_x")
                        // write vertices beginning with vn
                        fs << "vn ";

                    float value;
                    memcpy (&value, &mesh.cloud.data[i * point_size + mesh.cloud.fields[d].offset + c * sizeof (float)], sizeof (float));
                    fs << value;
                    if (++nxyz == 3)
                        break;
                    fs << " ";
                }
            }
            if (nxyz != 3)
            {
                PCL_ERROR ("[pcl::io::saveOBJFile] Input point cloud has no normals!\n");
                return (-2);
            }
            fs << std::endl;
        }

        fs << "# "<< nr_points <<" vertices normals" << std::endl;
    }

    fs << "# Face Definitions" << std::endl;
    // Write down faces
    if(normal_index == -1)
    {
        for(unsigned i = 0; i < nr_faces; i++)
        {
            fs << "f ";
            size_t j = 0;
            for (; j < mesh.polygons[i].vertices.size () - 1; ++j)
                fs << mesh.polygons[i].vertices[j] + 1 << " ";
            fs << mesh.polygons[i].vertices[j] + 1 << std::endl;
        }
    }
    else
    {
        for(unsigned i = 0; i < nr_faces; i++)
        {
            fs << "f ";
            size_t j = 0;
            for (; j < mesh.polygons[i].vertices.size () - 1; ++j)
                fs << mesh.polygons[i].vertices[j] + 1 << "//" << mesh.polygons[i].vertices[j] + 1 << " ";
            fs << mesh.polygons[i].vertices[j] + 1 << "//" << mesh.polygons[i].vertices[j] + 1 << std::endl;
        }
    }
    fs << "# End of File" << std::endl;

    // Close obj file
    fs.close ();
    return 0;
}

int newsaveOBJFile (const std::string &file_name,
        const pcl::PolygonMesh &mesh, unsigned precision=5)
{
    if (mesh.cloud.data.empty ())
    {
        PCL_ERROR ("[pcl::io::saveOBJFile] Input point cloud has no data!\n");
        return (-1);
    }
    // Open file
    std::ofstream fs;
    fs.precision (precision);
    fs.open (file_name.c_str ());

    /* Write 3D information */
    // number of points
    int nr_points  = mesh.cloud.width * mesh.cloud.height;
    // point size
    unsigned point_size = static_cast<unsigned> (mesh.cloud.data.size () / nr_points);
    // number of faces for header
    unsigned nr_faces = static_cast<unsigned> (mesh.polygons.size ());
    // Do we have vertices normals?
    int normal_index = getFieldIndex (mesh.cloud, "normal_x");
    const float *mesh_cloud_data = (float *)&mesh.cloud.data[0];

    // Write the header information
    fs << "####" << '\n';
    fs << "# OBJ dataFile simple version. File name: " << file_name << '\n';
    fs << "# Vertices: " << nr_points << '\n';
    if (normal_index != -1)
        fs << "# Vertices normals : " << nr_points << '\n';
    fs << "# Faces: " <<nr_faces << '\n';
    fs << "####" << '\n';

    // Write vertex coordinates
    fs << "# List of Vertices, with (x,y,z) coordinates, w is optional." << '\n';
    for (int i = 0; i < nr_points; ++i)
    {
        int xyz = 0;
        for (size_t d = 0; d < mesh.cloud.fields.size (); ++d)
        {
            int c = 0;
            // adding vertex
            if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && (
                    mesh.cloud.fields[d].name == "x" ||
                    mesh.cloud.fields[d].name == "y" ||
                    mesh.cloud.fields[d].name == "z"))
            {
                if (mesh.cloud.fields[d].name == "x")
                    // write vertices beginning with v
                    fs << "v ";

                float value;
                memcpy (&value, &mesh.cloud.data[i * point_size + mesh.cloud.fields[d].offset + c * sizeof (float)], sizeof (float));
                fs << value;
                if (++xyz == 3)
                    break;
                fs << " ";
            }
        }
        if (xyz != 3)
        {
            PCL_ERROR ("[pcl::io::saveOBJFile] Input point cloud has no XYZ data!\n");
            return (-2);
        }
        fs << '\n';
    }

    fs << "# "<< nr_points <<" vertices" << '\n';

    if(normal_index != -1)
    {
        fs << "# Normals in (x,y,z) form; normals might not be unit." <<  '\n';
        // Write vertex normals
        for (int i = 0; i < nr_points; ++i)
        {
            int nxyz = 0;
            for (size_t d = 0; d < mesh.cloud.fields.size (); ++d)
            {
                int c = 0;
                // adding vertex
                if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && (
                        mesh.cloud.fields[d].name == "normal_x" ||
                        mesh.cloud.fields[d].name == "normal_y" ||
                        mesh.cloud.fields[d].name == "normal_z"))
                {
                    if (mesh.cloud.fields[d].name == "normal_x")
                        // write vertices beginning with vn
                        fs << "vn ";

                    float value;
                    memcpy (&value, &mesh.cloud.data[i * point_size + mesh.cloud.fields[d].offset + c * sizeof (float)], sizeof (float));
                    fs << value;
                    if (++nxyz == 3)
                        break;
                    fs << " ";
                }
            }
            if (nxyz != 3)
            {
                PCL_ERROR ("[pcl::io::saveOBJFile] Input point cloud has no normals!\n");
                return (-2);
            }
            fs << '\n';
        }

        fs << "# "<< nr_points <<" vertices normals" << '\n';
    }

    fs << "# Face Definitions" << '\n';
    // Write down faces
    if(normal_index == -1)
    {
        for(unsigned i = 0; i < nr_faces; i++)
        {
            fs << "f ";
            size_t j = 0;
            for (; j < mesh.polygons[i].vertices.size () - 1; ++j)
                fs << mesh.polygons[i].vertices[j] + 1 << " ";
            fs << mesh.polygons[i].vertices[j] + 1 << '\n';
        }
    }
    else
    {
        for(unsigned i = 0; i < nr_faces; i++)
        {
            fs << "f ";
            size_t j = 0;
            for (; j < mesh.polygons[i].vertices.size () - 1; ++j)
                fs << mesh.polygons[i].vertices[j] + 1 << "//" << mesh.polygons[i].vertices[j] + 1 << " ";
            fs << mesh.polygons[i].vertices[j] + 1 << "//" << mesh.polygons[i].vertices[j] + 1 << '\n';
        }
    }
    fs << "# End of File" << '\n';

    // Close obj file
    fs.close ();
    return 0;
}

int main() {
    PointCloud<PointXYZ>::Ptr cloud(new PointCloud<PointXYZ>);
    for(int y = 0; y < 480; y++) {
        for (int x = 0; x < 640; x++) {
            cloud->points.push_back(PointXYZ(x,y,1));
        }
    }

    PolygonMesh mesh;
    toPCLPointCloud2(*cloud, mesh.cloud);

    StopWatch watch;
    watch.start();
    oldsaveOBJFile("pcl_saveOBJFile.obj", mesh);
    cout << "time for old_saveOBJFile = " <<  watch.stop() << "ms" << endl;

    watch.start();
    newsaveOBJFile("new_saveOBJFile.obj", mesh);
    cout << "time for new_saveOBJFile = " << watch.stop() << "ms" << endl;

    return 0;
}

Could you try to run this test-code to see if it makes a difference? And what setup are you using?

@andersgb1
Copy link
Contributor

If a third opinion helps, I get the following in Debug mode:

time for old_saveOBJFile = 1363ms
time for new_saveOBJFile = 803ms

And in Release:

time for old_saveOBJFile = 1335ms
time for new_saveOBJFile = 749ms

My system:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily

$ uname -a
Linux andersgb1-laptop 4.2.0-30-generic #36-Ubuntu SMP Fri Feb 26 00:58:07
UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ cat /proc/cpuinfo | grep Intel
vendor_id : GenuineIntel
model name : Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
vendor_id : GenuineIntel
model name : Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
vendor_id : GenuineIntel
model name : Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
vendor_id : GenuineIntel
model name : Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz

On Wed, Apr 6, 2016 at 1:12 AM, muscipula notifications@github.com wrote:

That is very strange, I've tested the following on Linux, Windows and OSX
across different machines, but in all cases, this patch sped up the save
function between 2 and 20 times (on SSD the speedup is around 2-3 while
much higher on the SATA disks).

#include
#include <pcl/point_cloud.h>
#include <pcl/io/obj_io.h>
#include <pcl/io/ply_io.h>
#include <sys/time.h>

using namespace std;
using namespace pcl;

class StopWatch
{
boost::posix_time::ptime before;
boost::posix_time::ptime after;
public:
void start() {
before = boost::posix_time::microsec_clock::local_time();
}

double stop() {
    after = boost::posix_time::microsec_clock::local_time();
    return (static_cast<double> ((after - before).total_milliseconds()));
}

};

int oldsaveOBJFile (const std::string &file_name,
const pcl::PolygonMesh &mesh, unsigned precision=5)
{
if (mesh.cloud.data.empty ())
{
PCL_ERROR ("[pcl::io::saveOBJFile] Input point cloud has no data!\n");
return (-1);
}
// Open file
std::ofstream fs;
fs.precision (precision);
fs.open (file_name.c_str ());

/* Write 3D information */
// number of points
int nr_points  = mesh.cloud.width * mesh.cloud.height;
// point size
unsigned point_size = static_cast<unsigned> (mesh.cloud.data.size () / nr_points);
// number of faces for header
unsigned nr_faces = static_cast<unsigned> (mesh.polygons.size ());
// Do we have vertices normals?
int normal_index = getFieldIndex (mesh.cloud, "normal_x");
const float *mesh_cloud_data = (float *)&mesh.cloud.data[0];

// Write the header information
fs << "####" << std::endl;
fs << "# OBJ dataFile simple version. File name: " << file_name << std::endl;
fs << "# Vertices: " << nr_points << std::endl;
if (normal_index != -1)
    fs << "# Vertices normals : " << nr_points << std::endl;
fs << "# Faces: " <<nr_faces << std::endl;
fs << "####" << std::endl;

// Write vertex coordinates
fs << "# List of Vertices, with (x,y,z) coordinates, w is optional." << std::endl;
for (int i = 0; i < nr_points; ++i)
{
    int xyz = 0;
    for (size_t d = 0; d < mesh.cloud.fields.size (); ++d)
    {
        int c = 0;
        // adding vertex
        if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && (
                mesh.cloud.fields[d].name == "x" ||
                mesh.cloud.fields[d].name == "y" ||
                mesh.cloud.fields[d].name == "z"))
        {
            if (mesh.cloud.fields[d].name == "x")
                // write vertices beginning with v
                fs << "v ";

            float value;
            memcpy (&value, &mesh.cloud.data[i * point_size + mesh.cloud.fields[d].offset + c * sizeof (float)], sizeof (float));
            fs << value;
            if (++xyz == 3)
                break;
            fs << " ";
        }
    }
    if (xyz != 3)
    {
        PCL_ERROR ("[pcl::io::saveOBJFile] Input point cloud has no XYZ data!\n");
        return (-2);
    }
    fs << std::endl;
}

fs << "# "<< nr_points <<" vertices" << std::endl;

if(normal_index != -1)
{
    fs << "# Normals in (x,y,z) form; normals might not be unit." <<  std::endl;
    // Write vertex normals
    for (int i = 0; i < nr_points; ++i)
    {
        int nxyz = 0;
        for (size_t d = 0; d < mesh.cloud.fields.size (); ++d)
        {
            int c = 0;
            // adding vertex
            if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && (
                    mesh.cloud.fields[d].name == "normal_x" ||
                    mesh.cloud.fields[d].name == "normal_y" ||
                    mesh.cloud.fields[d].name == "normal_z"))
            {
                if (mesh.cloud.fields[d].name == "normal_x")
                    // write vertices beginning with vn
                    fs << "vn ";

                float value;
                memcpy (&value, &mesh.cloud.data[i * point_size + mesh.cloud.fields[d].offset + c * sizeof (float)], sizeof (float));
                fs << value;
                if (++nxyz == 3)
                    break;
                fs << " ";
            }
        }
        if (nxyz != 3)
        {
            PCL_ERROR ("[pcl::io::saveOBJFile] Input point cloud has no normals!\n");
            return (-2);
        }
        fs << std::endl;
    }

    fs << "# "<< nr_points <<" vertices normals" << std::endl;
}

fs << "# Face Definitions" << std::endl;
// Write down faces
if(normal_index == -1)
{
    for(unsigned i = 0; i < nr_faces; i++)
    {
        fs << "f ";
        size_t j = 0;
        for (; j < mesh.polygons[i].vertices.size () - 1; ++j)
            fs << mesh.polygons[i].vertices[j] + 1 << " ";
        fs << mesh.polygons[i].vertices[j] + 1 << std::endl;
    }
}
else
{
    for(unsigned i = 0; i < nr_faces; i++)
    {
        fs << "f ";
        size_t j = 0;
        for (; j < mesh.polygons[i].vertices.size () - 1; ++j)
            fs << mesh.polygons[i].vertices[j] + 1 << "//" << mesh.polygons[i].vertices[j] + 1 << " ";
        fs << mesh.polygons[i].vertices[j] + 1 << "//" << mesh.polygons[i].vertices[j] + 1 << std::endl;
    }
}
fs << "# End of File" << std::endl;

// Close obj file
fs.close ();
return 0;

}

int newsaveOBJFile (const std::string &file_name,
const pcl::PolygonMesh &mesh, unsigned precision=5)
{
if (mesh.cloud.data.empty ())
{
PCL_ERROR ("[pcl::io::saveOBJFile] Input point cloud has no data!\n");
return (-1);
}
// Open file
std::ofstream fs;
fs.precision (precision);
fs.open (file_name.c_str ());

/* Write 3D information */
// number of points
int nr_points  = mesh.cloud.width * mesh.cloud.height;
// point size
unsigned point_size = static_cast<unsigned> (mesh.cloud.data.size () / nr_points);
// number of faces for header
unsigned nr_faces = static_cast<unsigned> (mesh.polygons.size ());
// Do we have vertices normals?
int normal_index = getFieldIndex (mesh.cloud, "normal_x");
const float *mesh_cloud_data = (float *)&mesh.cloud.data[0];

// Write the header information
fs << "####" << '\n';
fs << "# OBJ dataFile simple version. File name: " << file_name << '\n';
fs << "# Vertices: " << nr_points << '\n';
if (normal_index != -1)
    fs << "# Vertices normals : " << nr_points << '\n';
fs << "# Faces: " <<nr_faces << '\n';
fs << "####" << '\n';

// Write vertex coordinates
fs << "# List of Vertices, with (x,y,z) coordinates, w is optional." << '\n';
for (int i = 0; i < nr_points; ++i)
{
    int xyz = 0;
    for (size_t d = 0; d < mesh.cloud.fields.size (); ++d)
    {
        int c = 0;
        // adding vertex
        if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && (
                mesh.cloud.fields[d].name == "x" ||
                mesh.cloud.fields[d].name == "y" ||
                mesh.cloud.fields[d].name == "z"))
        {
            if (mesh.cloud.fields[d].name == "x")
                // write vertices beginning with v
                fs << "v ";

            float value;
            memcpy (&value, &mesh.cloud.data[i * point_size + mesh.cloud.fields[d].offset + c * sizeof (float)], sizeof (float));
            fs << value;
            if (++xyz == 3)
                break;
            fs << " ";
        }
    }
    if (xyz != 3)
    {
        PCL_ERROR ("[pcl::io::saveOBJFile] Input point cloud has no XYZ data!\n");
        return (-2);
    }
    fs << '\n';
}

fs << "# "<< nr_points <<" vertices" << '\n';

if(normal_index != -1)
{
    fs << "# Normals in (x,y,z) form; normals might not be unit." <<  '\n';
    // Write vertex normals
    for (int i = 0; i < nr_points; ++i)
    {
        int nxyz = 0;
        for (size_t d = 0; d < mesh.cloud.fields.size (); ++d)
        {
            int c = 0;
            // adding vertex
            if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && (
                    mesh.cloud.fields[d].name == "normal_x" ||
                    mesh.cloud.fields[d].name == "normal_y" ||
                    mesh.cloud.fields[d].name == "normal_z"))
            {
                if (mesh.cloud.fields[d].name == "normal_x")
                    // write vertices beginning with vn
                    fs << "vn ";

                float value;
                memcpy (&value, &mesh.cloud.data[i * point_size + mesh.cloud.fields[d].offset + c * sizeof (float)], sizeof (float));
                fs << value;
                if (++nxyz == 3)
                    break;
                fs << " ";
            }
        }
        if (nxyz != 3)
        {
            PCL_ERROR ("[pcl::io::saveOBJFile] Input point cloud has no normals!\n");
            return (-2);
        }
        fs << '\n';
    }

    fs << "# "<< nr_points <<" vertices normals" << '\n';
}

fs << "# Face Definitions" << '\n';
// Write down faces
if(normal_index == -1)
{
    for(unsigned i = 0; i < nr_faces; i++)
    {
        fs << "f ";
        size_t j = 0;
        for (; j < mesh.polygons[i].vertices.size () - 1; ++j)
            fs << mesh.polygons[i].vertices[j] + 1 << " ";
        fs << mesh.polygons[i].vertices[j] + 1 << '\n';
    }
}
else
{
    for(unsigned i = 0; i < nr_faces; i++)
    {
        fs << "f ";
        size_t j = 0;
        for (; j < mesh.polygons[i].vertices.size () - 1; ++j)
            fs << mesh.polygons[i].vertices[j] + 1 << "//" << mesh.polygons[i].vertices[j] + 1 << " ";
        fs << mesh.polygons[i].vertices[j] + 1 << "//" << mesh.polygons[i].vertices[j] + 1 << '\n';
    }
}
fs << "# End of File" << '\n';

// Close obj file
fs.close ();
return 0;

}

int main() {
PointCloud::Ptr cloud(new PointCloud);
for(int y = 0; y < 480; y++) {
for (int x = 0; x < 640; x++) {
cloud->points.push_back(PointXYZ(x,y,1));
}
}

PolygonMesh mesh;
toPCLPointCloud2(*cloud, mesh.cloud);

StopWatch watch;
watch.start();
oldsaveOBJFile("pcl_saveOBJFile.obj", mesh);
cout << "time for old_saveOBJFile = " <<  watch.stop() << "ms" << endl;

watch.start();
newsaveOBJFile("new_saveOBJFile.obj", mesh);
cout << "time for new_saveOBJFile = " << watch.stop() << "ms" << endl;

return 0;

}

Could you try to run this test-code to see if it makes a difference? And
what setup are you using?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#1580 (comment)

@VictorLamoine
Copy link
Contributor

The test code is working faster, I'll test again your patch and make sure I'm not making anything stupid.

Here are my results:

time for old_saveOBJFile = 881ms
time for new_saveOBJFile = 396ms

Ubuntu 14.04 (Kernel 3.16)
Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz
SSD

@matlabbe
Copy link

matlabbe commented Apr 9, 2016

For info, on Project Tango Tablet Development Kit:

time for old_saveOBJFile = 50324 ms
time for new_saveOBJFile = 5237 ms

~10 times faster!

@morrisfranken
Copy link
Contributor Author

Good to hear that the test code does speedup the save function, even on Project tango!
@VictorLamoine do you have an update on status of the patch?

@VictorLamoine
Copy link
Contributor

I confirm the improvement results;

time for old_saveOBJFile = 895ms
time for new_saveOBJFile = 377ms

With bigger point clouds;

time for old_saveOBJFile = 8885ms
time for new_saveOBJFile = 4042ms

I've tested on several platforms and this fix never lowers the performance.

👍 for merging

@SergioRAgostinho SergioRAgostinho merged commit 62600ee into PointCloudLibrary:master Jun 30, 2016
animecomico pushed a commit to animecomico/pcl that referenced this pull request Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants