{"id":16304939,"url":"https://github.com/moznion/sprint","last_synced_at":"2025-07-22T02:38:24.805Z","repository":{"id":55158831,"uuid":"60393783","full_name":"moznion/sprint","owner":"moznion","description":"Fluent, small and fast String formatter for Java","archived":false,"fork":false,"pushed_at":"2021-01-06T11:11:11.000Z","size":63,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-05T18:08:17.944Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moznion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-04T04:50:23.000Z","updated_at":"2021-01-06T11:11:13.000Z","dependencies_parsed_at":"2022-08-14T13:51:42.046Z","dependency_job_id":null,"html_url":"https://github.com/moznion/sprint","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/moznion/sprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fsprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fsprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fsprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fsprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moznion","download_url":"https://codeload.github.com/moznion/sprint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fsprint/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266413528,"owners_count":23924747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T21:05:14.697Z","updated_at":"2025-07-22T02:38:24.775Z","avatar_url":"https://github.com/moznion.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"sprint\n======\n\n![Check](https://github.com/moznion/sprint/workflows/Check/badge.svg)\n\nFluent, small and fast String formatter for Java.\n\nSynopsis\n--------\n\n```java\nfinal Sprint sprint = new Sprint();\nSystem.out.Println(sprint.ff(\"Hello: {}!\", \"John\")); // =\u003e Hello: John!\n```\n\nDescription\n-----------\n\nsprint is a formatter for String.\n\nThis library provides a formating method `ff`,\nthis method formats String according to fluent (or loose?) template like `\"{}:{}\"`.\n`{}` is a placeholder to fill any arguments.\nThis method takes arguments after template and fill those into placeholder.\n\nThis method parses template __only at once__.\nParsed structure is stored on ConcurrentHashMap which is contained in instance of Sprint.\nWhen it formats String with the same template, it uses pre-parsed structures from the second time.\n\nBenchmark\n---------\n\nBenchmark project is [here](https://github.com/moznion/sprint-bench). This is a result of jdk1.8.0\\_92.\n\n![benchmark_graph](./devel/benchmark.png)\n\n### n=10000\n\n```\nScore:\n\nsprintff:  0 wallclock secs ( 0.01 usr +  0.00 sys =  0.01 CPU) @ 798977.31/s (n=10000)\nstringFormat:  0 wallclock secs ( 0.11 usr +  0.01 sys =  0.13 CPU) @ 77924.71/s (n=10000)\n\nComparison chart:\n\n                    Rate  sprintff  stringFormat\n      sprintff  798977/s        --          925%\n  stringFormat   77925/s      -90%            --\n```\n\n### n=100000\n\n```\nScore:\n\nsprintff:  0 wallclock secs ( 0.06 usr +  0.03 sys =  0.09 CPU) @ 1143850.66/s (n=100000)\nstringFormat:  0 wallclock secs ( 0.50 usr +  0.00 sys =  0.51 CPU) @ 197784.81/s (n=100000)\n\nComparison chart:\n\n                     Rate  sprintff  stringFormat\n      sprintff  1143851/s        --          478%\n  stringFormat   197785/s      -83%            --\n```\n\nHints\n--\n\nThis class should be used as singleton because cache of parsed result of template is stored on __instance__ field\n\nTODO\n----\n\n- `sprintf` compatible template\n\nAuthor\n------\n\nmoznion (\u003cmoznion@gmail.com\u003e)\n\nLicense\n-------\n\n```\nThe MIT License (MIT)\nCopyright © 2016 moznion, http://moznion.net/ \u003cmoznion@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the “Software”), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fsprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoznion%2Fsprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fsprint/lists"}